//
//  ViewController.m
//  封装UIView
//
//  Created by adiljan on 16/9/2.
//  Copyright © 2016年 adiljan. All rights reserved.
//

#import "ViewController.h"
#import "CustomView.h"
#import "CustomModel.h"

@interface ViewController ()<CustomProtocol>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    // 创建自定义的View
    CustomView *customView = [[CustomView alloc] init];
    // 设置数据
    CustomModel *model = [CustomModel modelWithName:@"hosea_zhou" titleColor:@"6122AE" icon:@"123.jpg"];
    customView.model = model;
    // 设置frame
    customView.frame = CGRectMake(100, 100, 67, 100);
    // 添加子控件
    [self.view addSubview:customView];
    
    customView.myDelegate = self;
//    [customView setBtnClickBlock:^{
//        NSLog(@"点击了  执行了点击事件");
//    }];
}

- (void)clickButton:(UIButton *)sender{
    NSLog(@"点击了  执行了点击事件");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
